﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="usrClass.ascx.cs" Inherits="controls_usrClass" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/controls/usrCarDriverDetails.ascx" TagName="usrCarDriver" TagPrefix="uc4" %>
<%@ Register Src="~/controls/usrMobilePhone.ascx" TagName="usrPhoneNo" TagPrefix="uc10" %>
<%@ Register Src="~/controls/usrOccupation.ascx" TagName="usrOccupation" TagPrefix="uc5" %>
<%@ Register Src="~/controls/usrGender.ascx" TagName="usrGender" TagPrefix="uc3" %>
<link href="/css/popup_login.css" rel="stylesheet" type="text/css" />
<script src="/includes/ValidationError-NEW.js" type="text/javascript"></script>
<script src="/includes/ValidationEffect-NEW.js" type="text/javascript"></script>
<div class="body">
    <div class="sr_wrapper_travel_new bg_popup" style="width: 890px; padding: 20px; border: 9px solid #3b3b3b;
        overflow: visible; height: auto;">
        <!-- Column Content | Start -->
        <div class="body_sub">
            <div style="float: left"><h1><%=GetGlobalResourceObject("CarInsurance", "Assumption")%></h1></div>
            <div style="float: right">
                <asp:Button ID="btnClose" CssClass="button_close" runat="server" AlternateText="Close"
                    ToolTip="Close" CausesValidation="False" OnClientClick="HidePopupClass();ShowHideClassPanel(true);return false;" />
            </div>
            <div class="clear"></div>
            <div id="CarForm">
                <!-- Form | Start -->
                <asp:Label ID="lblMessage" runat="server"></asp:Label>
                <asp:ValidationSummary ID="vsCarDetail" runat="server" ValidationGroup="cardetail"
                    ShowSummary="True" HeaderText="<%$ Resources:Menu,RequiredValidation%>" CssClass="errorSummary" />
                <div class="form_col_1_sub left">
                    <asp:Label ID="lblInsuranceType" runat="server" Text="<%$ Resources:CarInsurance,InsuranceType%>" /></div>
                <div class="form_col_2 left">
                    <asp:UpdatePanel ID="uplInsuranceType" runat="server">
                        <ContentTemplate>
                            <asp:DropDownList ID="ddlInsuranceType" runat="server" AutoPostBack="True" onchange="SetDisplay(this.value);"
                                OnSelectedIndexChanged="ddlInsuranceType_SelectedIndexChanged">
                                <%--<asp:ListItem Value="-1" Text="<%$ Resources:CarInsurance,Select%>" />--%>
                                <asp:ListItem Value="10" Text="<%$ Resources:CarInsurance,Insurance_ClassOne%>" />
                                <asp:ListItem Value="21" Text="<%$ Resources:CarInsurance,Insurance_ClassTwoPlus%>" />
                                <asp:ListItem Value="31" Text="<%$ Resources:CarInsurance,Insurance_ClassThreePlus%>" />
                                <asp:ListItem Value="30" Text="<%$ Resources:CarInsurance,Insurance_ClassThree%>" />
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvInsuranceType"
                                ControlToValidate="ddlInsuranceType" InitialValue="-1" runat="server" ErrorMessage=""
                                Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <div class="clear">
                </div>
                <div id="divGarageType" runat="server">
                    <div class="seperator_form">
                    </div>
                    <div class="form_col_1_sub left">
                        <asp:Label ID="lblGarageType" runat="server" Text="<%$ Resources:CarInsurance,GarageType%>" />
                    </div>
                    <div class="form_col_2 left">
                        <asp:DropDownList ID="ddlGarageType" runat="server">
                            <asp:ListItem Value="-1" Text="<%$ Resources:CarInsurance,Select%>" />
                            <asp:ListItem Value="1" Selected="True" Text="<%$ Resources:CarInsurance,Garage_Authorized%>" />
                            <asp:ListItem Value="2" Text="<%$ Resources:CarInsurance,Garage_Dealer%>" />
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvGarageType"
                            ControlToValidate="ddlGarageType" InitialValue="-1" runat="server" ErrorMessage=""
                            Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                    </div>
                    <div class="left">
                        <a runat="server" href="<%$ Resources:CarInsuranceToolTips,GarageType%>" class="jTip"
                            id="two" name="<%$ Resources:CarInsurance,Help%>">
                            <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></a></div>
                </div>
                <div class="seperator_form">
                </div>
                <div>
                    <div class="form_col_1_sub left">
                        <asp:Label ID="lblCarModelYear" runat="server" Text="<%$ Resources:CarInsurance,CarModelYear%>" /></div>
                    <div class="form_col_2 left">
                        <asp:UpdatePanel ID="uplManYear" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlManufactYear" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlManufactYear_SelectedIndexChanged">
                                    <asp:ListItem Text="<%$ Resources:CarInsurance,Select%>" Value="-1" />
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvManufactYear"
                                    ControlToValidate="ddlManufactYear" InitialValue="-1" runat="server" ErrorMessage=""
                                    Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div class="seperator_form">
                </div>
                <div>
                    <div class="form_col_1_sub left">
                        <asp:Label ID="lblCarMakeModel" runat="server" Text="<%$ Resources:CarInsurance,CarMakeModel%>" /></div>
                    <div class="form_col_2 left">
                        <asp:UpdatePanel ID="uplCarInfo" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList runat="server" ID="ddlCarMake" AutoPostBack="true" OnSelectedIndexChanged="ddlCarMake_SelectedIndexChanged">
                                    <asp:ListItem Text="<%$ Resources:CarInsurance,Select%>" Value="-1" />
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCarMake" ControlToValidate="ddlCarMake"
                                    InitialValue="-1" runat="server" ErrorMessage="" Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                <asp:DropDownList runat="server" ID="ddlModelBodyCCDoor" AutoPostBack="True" OnSelectedIndexChanged="ddlModelBodyCCDoor_SelectedIndexChanged">
                                    <asp:ListItem Value="-1" Text="<%$ Resources:CarInsurance,Select%>"></asp:ListItem>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvModelBodyCCDoor"
                                    ControlToValidate="ddlModelBodyCCDoor" InitialValue="-1" runat="server" ErrorMessage=""
                                    Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                <asp:Label Visible="false" runat="server" ID="lblModelDesc" />
                                <asp:Label runat="server" ID="lblCarVehicleType" Text="" Visible="false" />
                            </ContentTemplate>
                        </asp:UpdatePanel>
                    </div>
                </div>
                <div id="divYesAccMod" runat="server">
                    <div class="seperator_form">
                    </div>
                    <div class="form_col_1_sub left" style="white-space: nowrap">
                        <asp:Label ID="lblYesAccModTitle" runat="server" Text="<%$ Resources:CarInsurance,AccessaryAndModification%>" /></div>
                    <div class="form_col_2 left">
                        <div class="form_col_2 left">
                            <asp:RadioButton ID="rdoYesAccMod" onclick="CheckAccMod();CheckAccModValidationCss();"
                                runat="server" GroupName="accmod" />
                            <asp:Label ID="lblYesAccMod" runat="server" Text="<%$ Resources:CarInsurance,Option_YesHave%>"></asp:Label>
                            &nbsp;
                            <asp:RadioButton ID="rdoNoAccMod" onclick="CheckAccMod();CheckAccModValidationCss();"
                                runat="server" GroupName="accmod" Checked="true" />
                            <asp:Label ID="lblNoAccMod" runat="server" Text="<%$ Resources:CarInsurance,Option_NoHave%>"></asp:Label>
                            <div style="display: none">
                                <asp:TextBox ID="txtAccMod" runat="server"></asp:TextBox>
                            </div>
                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvAccMod" runat="server"
                                ControlToValidate="txtAccMod" ErrorMessage="" ValidationGroup="cardetail" Display="Dynamic"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="left">
                        <a runat="server" href="<%$Resources:CarInsuranceToolTips,AccAndMod%>" class="jTip"
                            id="A1" name="<%$ Resources:CarInsurance,Help%>">
                            <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></a></div>
                </div>
                <div id="divAccModAmount" style="display: none;">
                    <div class="form_col_1_sub comp left">
                        <asp:Label ID="lblAccModAmountTitle" runat="server" Text="<%$ Resources:CarInsurance,AccessaryAndModificationAmount%>" /></div>
                    <div class="form_col_2 left">
                        <asp:TextBox ID="txtAccModAmount" runat="server" MaxLength="7" />
                        <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvAccModAmount"
                            runat="server" ControlToValidate="txtAccModAmount" ErrorMessage="" ValidationGroup="cardetail"
                            Display="Dynamic"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator CssClass="validationErrorControl" ID="revAccModAmount"
                            ValidationExpression="^\d+$" runat="server" ControlToValidate="txtAccModAmount"
                            ErrorMessage="" ValidationGroup="cardetail" Display="Dynamic"></asp:RegularExpressionValidator>
                        <asp:CustomValidator CssClass="validationErrorControl" ID="csvAccModAmount" ClientValidationFunction="CheckAccModAmount"
                            OnServerValidate="CheckAccModAmount" runat="server" ControlToValidate="txtAccModAmount"
                            ErrorMessage="" ValidationGroup="cardetail" Display="Dynamic"></asp:CustomValidator>
                    </div>
                </div>
                <div style="display: none;">
                    <div class="form_col_1_sub comp left">
                        <asp:Label ID="lblVehicleType" runat="server" Text="<%$ Resources:CarInsurance,VehicleType%>" /></div>
                    <div class="form_col_2 left">
                        <asp:UpdatePanel ID="uplVehicleType" runat="server">
                            <ContentTemplate>
                                <asp:DropDownList ID="ddlVehicleType" runat="server" OnSelectedIndexChanged="ddlVehicleType_SelectedIndexChanged"
                                    AutoPostBack="True">
                                    <%--<asp:ListItem Value="-1" Text="<%$ Resources:CarInsurance,Select%>" />--%>
                                    <asp:ListItem Value="110" Text="<%$ Resources:CarInsurance,VehicleType_Private%>" />
                                    <%--<asp:ListItem Value="120" Text="<%$ Resources:CarInsurance,VehicleType_Commercial%>" />--%>
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvVehicleType"
                                    ControlToValidate="ddlVehicleType" InitialValue="-1" runat="server" ErrorMessage=""
                                    Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                            </ContentTemplate>
                        </asp:UpdatePanel>
                        <div id="divSumInsured" style="display: none;">
                            <div>
                                <div class="indicator trebo_font">
                                    <asp:UpdatePanel ID="uplSumInsured" runat="server">
                                        <ContentTemplate>
                                            <asp:Label runat="server" Text="<%$ Resources:CarInsurance,SumInsured%>" ID="lblSumInsuredTitle"
                                                Visible="false" />
                                            <asp:Label runat="server" ID="lblSumInsured" Text="0" Visible="false" />
                                            <div style="display: none">
                                                <asp:TextBox ID="txtSumInsured" MaxLength="9" Width="80px" runat="server" />
                                                <asp:TextBox ID="txtNewSumInsured" MaxLength="9" Width="80px" runat="server" />
                                                <asp:TextBox ID="txtGroupNo" Text="-1" MaxLength="2" Width="30px" runat="server" />
                                            </div>
                                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvSumInsured"
                                                InitialValue="0" ControlToValidate="txtSumInsured" runat="server" ErrorMessage=""
                                                Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                            <asp:RegularExpressionValidator CssClass="validationErrorControl" ID="revSumInsured"
                                                ValidationExpression="^\d+$" ControlToValidate="txtSumInsured" runat="server"
                                                ErrorMessage="" Text="" ValidationGroup="cardetail"></asp:RegularExpressionValidator>
                                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvGroupNo" InitialValue="-1"
                                                ControlToValidate="txtSumInsured" runat="server" ErrorMessage="" Text="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </div>
                            <div class="clear">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="seperator_form">
                </div>
                <div id="divDeduct" runat="server">
                    <div class="form_col_1_sub left">
                        <asp:Label ID="lblDeduct" runat="server" Text="<%$ Resources:CarInsurance,DEC%>" /></div>
                    <div class="form_col_2 left">
                        <asp:DropDownList ID="ddlDeduct" Width="145px" runat="server">
                            <%--<asp:ListItem Text="<%$ Resources:CarInsurance,Select%>" Value="-1" />--%>
                            <asp:ListItem Text="<%$ Resources:CarInsurance,Option_DeductNo%>" Value="0" />
                            <asp:ListItem Text="<%$ Resources:CarInsurance,Option_DeductYes%>" Value="5000" />
                            <asp:ListItem Text="<%$ Resources:CarInsurance,Option_DeductAll%>" Selected="True"
                                Value="-1" />
                        </asp:DropDownList>
                        <%--                                    <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvDeduct" ControlToValidate="ddlDeduct"
                                        runat="server" ErrorMessage="" Text="" InitialValue="-1" ValidationGroup="cardetail"></asp:RequiredFieldValidator>--%>
                    </div>
                    <div class="seperator_form">
                    </div>
                </div>
                <div id="divProvinceofRegistration" runat="server">
                    <div>
                        <div class="form_col_1_sub left">
                            <asp:Label ID="lblProvinceofRegistration" runat="server" Text="<%$ Resources:CarInsurance,ProvinceofRegistration%>" /></div>
                        <div class="form_col_2 left">
                            <asp:DropDownList ID="ddlProvinceRegistration" Width="145px" runat="server">
                                <asp:ListItem Text="<%$ Resources:CarInsurance,Select%>" Value="-1" />
                                <asp:ListItem Text="<%$ Resources:CarInsurance,Province_BKK%>" Selected="True" Value="BKK" />
                                <asp:ListItem Text="<%$ Resources:CarInsurance,Province_UPC%>" Value="UPC" />
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvProvinceRegistration"
                                ControlToValidate="ddlProvinceRegistration" runat="server" ErrorMessage="" Text=""
                                InitialValue="-1" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="seperator_form">
                    </div>
                </div>
                <div id="idAnyClaimLastYear" runat="server">
                    <div>
                        <div class="form_col_1_sub comp left">
                            <asp:Label ID="lblAnyClaimLastYear" runat="server" Text="<%$ Resources:CarInsurance,AnyClaimLastYear%>" /></div>
                        <div class="form_col_2 left">
                            <asp:RadioButton ID="rdoYesClaimLastYear" onclick="CheckClaim();CheckClaimValidationCss();"
                                runat="server" GroupName="anyclaim"></asp:RadioButton>
                            <asp:Label ID="lblYesClaimLastYear" runat="server" Text="<%$ Resources:CarInsurance,Option_YesHave%>"></asp:Label>
                            &nbsp;
                            <asp:RadioButton ID="rdoNoClaimLastYear" onclick="CheckClaim();CheckClaimValidationCss();"
                                runat="server" GroupName="anyclaim" Checked="true"></asp:RadioButton>
                            <asp:Label ID="lblNoClaimLastYear" runat="server" Text="<%$ Resources:CarInsurance,Option_NoHave%>"></asp:Label>
                            <div style="display: none">
                                <asp:TextBox ID="txtAnyClaim" runat="server"></asp:TextBox>
                            </div>
                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvAnyClaim" runat="server"
                                ControlToValidate="txtAnyClaim" ErrorMessage="" ValidationGroup="cardetail" Display="Dynamic"
                                Text=""></asp:RequiredFieldValidator>
                        </div>
                    </div>
                    <div class="seperator_form">
                    </div>
                </div>
                <div id="idNCB" runat="server">
                    <div>
                        <div class="form_col_1_sub left">
                            <asp:Label ID="lblNCB" runat="server" Text="<%$ Resources:CarInsurance,NCB%>" /></div>
                        <div class="form_col_2 left">
                            <asp:DropDownList ID="ddlNCB" Width="80px" runat="server">
                                <asp:ListItem Text="<%$ Resources:CarInsurance,Select%>" Value="-1"></asp:ListItem>
                                <asp:ListItem Text="0" Value="0"></asp:ListItem>
                                <asp:ListItem Text="20" Value="20"></asp:ListItem>
                                <asp:ListItem Text="30" Value="30"></asp:ListItem>
                                <asp:ListItem Text="40" Value="40"></asp:ListItem>
                                <asp:ListItem Text="50" Selected="True" Value="50"></asp:ListItem>
                            </asp:DropDownList>
                            %
                            <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvNCB" Enabled="true"
                                runat="server" InitialValue="-1" ControlToValidate="ddlNCB" ErrorMessage="" ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                        </div>
                        <div class="left">
                            <a runat="server" href="<%$Resources:CarInsuranceToolTips,NCB%>" class="jTip" id="A3"
                                name="<%$ Resources:CarInsurance,Help%>">
                                <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></a></div>
                    </div>
                    <div class="seperator_form">
                    </div>
                </div>
                <div id="divDriver" runat="server">
                    <asp:UpdatePanel ID="updDriver" EnableViewState="true" runat="server">
                        <ContentTemplate>
                            <div runat="server" id="divSpecifyDriver" visible="true">
                                <div class="form_col_1_sub left">
                                    <asp:Label ID="lblSpecifyNamedDriver" runat="server" Text="<%$ Resources:CarInsurance,SpecifyNamedDriver%>" /></label></div>
                                <div class="form_col_2 left" id="divYesAddDriver">
                                    <asp:RadioButton AutoPostBack="true" ID="rdoYesAddDriver" CausesValidation="false"
                                        runat="server" GroupName="adddriver" OnCheckedChanged="rdoYesAddDriver_CheckedChanged" />
                                    <asp:Label ID="lblYesAddDriver" runat="server" Text="<%$ Resources:CarInsurance,Option_YesSpecify%>"></asp:Label>
                                    &nbsp;
                                    <asp:RadioButton AutoPostBack="true" ID="rdoNoAddDriver" CausesValidation="false"
                                        Checked="true" runat="server" GroupName="adddriver" OnCheckedChanged="rdoNoAddDriver_CheckedChanged" />
                                    <asp:Label ID="lblNoAddDriver" runat="server" Text="<%$ Resources:CarInsurance,Option_NoSpecify%>"></asp:Label>
                                    <div style="display: none">
                                        <asp:TextBox ID="txtAddDriver" runat="server"></asp:TextBox>
                                    </div>
                                    <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvAddDriver" runat="server"
                                        ControlToValidate="txtAddDriver" ErrorMessage="" ValidationGroup="cardetail"
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                </div>
                                <div class="left">
                                    <a runat="server" href="<%$Resources:CarInsuranceToolTips,DriverName%>" class="jTip"
                                        id="three" name="<%$ Resources:CarInsurance,Help%>">
                                        <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></a></div>
                            </div>
                            <div class="seperator_form">
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <asp:UpdatePanel ID="uplDriverList" EnableViewState="true" runat="server">
                        <ContentTemplate>
                            <div id="divAddDriver" runat="server" visible="false">
                                <div class="form_col_1_sub left">
                                    <asp:Label ID="lblNoOfAdditionalDrivers" runat="server" Text="<%$ Resources:CarInsurance,NoOfNamedDrivers%>" /></div>
                                <div class="form_col_2 left">
                                    <asp:DropDownList CausesValidation="false" AutoPostBack="true" ID="ddlDriverCount"
                                        runat="server" Width="50px" OnSelectedIndexChanged="ddlDriverCount_SelectedIndexChanged">
                                        <asp:ListItem>1</asp:ListItem>
                                        <asp:ListItem>2</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvNoOfDriver"
                                        runat="server" ControlToValidate="ddlDriverCount" InitialValue="-1" ErrorMessage=""
                                        ValidationGroup="cardetail"></asp:RequiredFieldValidator>
                                </div>
                            </div>
                            <asp:Panel ID="pnlDriver" runat="server" Width="100%">
                                <div id="divDriver1" runat="server" visible="false">
                                    <uc4:usrCarDriver ID="UsrCarDriver1" runat="server" DriverNo="1" ValidationGroup="cardetail"
                                        IsEnabled="true" />
                                </div>
                                <div id="divDriver2" runat="server" visible="false">
                                    <uc4:usrCarDriver ID="UsrCarDriver2" runat="server" DriverNo="2" ValidationGroup="cardetail"
                                        IsEnabled="true" />
                                </div>
                            </asp:Panel>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <div id="divCTPL" runat="server" style="display: none;">
                    <div class="form_col_1_sub left">
                        <asp:Label ID="lblCTPL" runat="server" Text="<%$ Resources:CarInsurance,CTPL%>" /></div>
                    <div class="form_col_2 left">
                        <asp:RadioButton ID="rdoYesCTPL" onclick="CheckCTPL();CheckCTPLValidationCss();"
                            runat="server" GroupName="ctpl" />
                        <asp:Label ID="lblYesCTPL" runat="server" Text="<%$ Resources:CarInsurance,Option_Yes%>"></asp:Label>
                        &nbsp;
                        <asp:RadioButton ID="rdoNoCTPL" onclick="CheckCTPL();CheckCTPLValidationCss();" runat="server"
                            GroupName="ctpl" Checked="true" />
                        <asp:Label ID="lblNoCTPL" runat="server" Text="<%$ Resources:CarInsurance,Option_No%>"></asp:Label>
                        <div style="display: none">
                            <asp:TextBox ID="txtCTPL" runat="server"></asp:TextBox>
                        </div>
                        <asp:RequiredFieldValidator CssClass="validationErrorControl" ID="rfvCTPL" runat="server"
                            ControlToValidate="txtCTPL" ErrorMessage="" ValidationGroup="cardetail" Display="Dynamic"></asp:RequiredFieldValidator>
                    </div>
                    <div class="seperator_form">
                    </div>
                </div>
                <div style="display:none">
                    <div class="form_col_1_sub comp left">
                        <asp:Label ID="lblName" runat="server" Text="<%$ Resources:CarInsurance,Name%>" /></div>
                    <div class="form_col_2 left">
                        <asp:TextBox ID="txtName" Width="230" MaxLength="50" runat="server"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rfvName" runat="server" CssClass="validationErrorControl"
                            ValidationGroup="cardetail" ErrorMessage="" Text="" ControlToValidate="txtName"></asp:RequiredFieldValidator>
                        <asp:RegularExpressionValidator ID="revName" runat="server" ValidationGroup="cardetail"
                            ValidationExpression="^[\p{L}\d]*[^#$%^&*():/\.'^<>]*$" CssClass="validationErrorControl"
                            ControlToValidate="txtName" ErrorMessage=""></asp:RegularExpressionValidator>
                    </div>
                    <div class="seperator_form">
                    </div>
                    <asp:UpdatePanel ID="uplConfirmEmail" runat="server">
                        <ContentTemplate>
                            <div>
                                <div class="form_col_1_sub left">
                                    <asp:Label ID="lblEmail" runat="server" Text="<%$ Resources:CarInsurance,EmailAddress%>" /></div>
                                <div class="form_col_2 left">
                                    <asp:TextBox ID="txtEmailAddress" runat="server" MaxLength="100" Width="230" AutoPostBack="true"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfvEmail" runat="server" Text="" CssClass="validationErrorControl"
                                        ValidationGroup="cardetail" ErrorMessage="" ControlToValidate="txtEmailAddress"
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="rfvEmailValid" Text="" CssClass="validationErrorControl"
                                        runat="server" ValidationGroup="cardetail" ErrorMessage="" ControlToValidate="txtEmailAddress"
                                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" Display="Dynamic"></asp:RegularExpressionValidator>
                                </div>
                                <div class="left">
                                    <a runat="server" href="<%$Resources:CarInsuranceToolTips,Email%>" class="jTip" id="A4"
                                        name="<%$ Resources:CarInsurance,Help%>">
                                        <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></a></div>
                            </div>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <div class="seperator_form">
                    </div>
                    <div>
                        <div class="form_col_1_sub left">
                            <asp:Label ID="lblMobileNo" runat="server" Text="<%$ Resources:CarInsurance,MobileNo%>" /></div>
                        <div class="form_col_2 left">
                            <uc10:usrPhoneNo ID="txtMobileNo" ValidationGroup="cardetail" IsEnabled="true" PhoneNoErrorMessage="Mobile Phone No must be number value."
                                PhoneNoValidErrorMessage="Mobile phone no is not valid." IsRequired="true" PhoneNoRequireErrorMessage="Require Mobile Phone No."
                                runat="server" />
                        </div>
                        <div class="left">
                            <a runat="server" href="<%$Resources:CarInsuranceToolTips,Mobile%>" class="jTip"
                                id="A5" name="<%$ Resources:CarInsurance,Help%>">
                                <img src="/images/icon/help.png" width="20" height="20" alt="Help" /></a></div>
                    </div>
                    <div class="seperator_form">
                    </div>
                    <div>
                        <div class="form_col_1_sub left">
                            <asp:Label ID="lblOccupation" runat="server" Text="<%$ Resources:CarInsurance,Occupation%>" /></div>
                        <div class="form_col_2 left">
                            <uc5:usrOccupation ID="ddlOccupation" runat="server" IsEnabled="true" ValidationGroup="cardetail"
                                ErrorMessage="" />
                        </div>
                    </div>
                    <div class="seperator_form">
                    </div>
                </div>
                <asp:CheckBox ID="checkIsAgreement" runat="server" Checked="true" Text="<%$ Resources:CarInsurance,Agreement%>" />
                <div>
                    <div>
                        <div class="form_col_1_sub left">
                            &nbsp;
                        </div>
                        <div class="form_col_2 left">
                            <asp:Button ID="ibtNext" onmousedown="this.className = 'button_refreshquote_mousedown';"
                                onmouseup="this.className = 'button_refreshquote';" onmouseout="this.className = 'button_refreshquote';"
                                CssClass="button_refreshquote" OnClientClick="LoadValidationErrorCss();CheckOptionValidationCss();if (Page_ClientValidate('cardetail')){this.removeAttribute('onmouseout');this.removeAttribute('onmouseup');this.className = 'button_processing';}"
                                runat="server" ValidationGroup="cardetail" AlternateText="Refresh Quote" ToolTip="Refresh Quote"
                                CausesValidation="true" OnClick="btnNext_Click" />
                        </div>
                    </div>
                    <!-- Form | End   -->
                </div>
            </div>
        </div>
    </div>
</div>
<div id="divHiddenMonths" style="display: none;">
    <input runat="server" id="lblJan" type="hidden" value="<%$ Resources:MonthResource, January%>" />
    <input runat="server" id="lblFeb" type="hidden" value="<%$ Resources:MonthResource, February%>" />
    <input runat="server" id="lblMar" type="hidden" value="<%$ Resources:MonthResource, March%>" />
    <input runat="server" id="lblApr" type="hidden" value="<%$ Resources:MonthResource, April%>" />
    <input runat="server" id="lblMay" type="hidden" value="<%$ Resources:MonthResource, May%>" />
    <input runat="server" id="lblJun" type="hidden" value="<%$ Resources:MonthResource, June%>" />
    <input runat="server" id="lblJul" type="hidden" value="<%$ Resources:MonthResource, July%>" />
    <input runat="server" id="lblAug" type="hidden" value="<%$ Resources:MonthResource, August%>" />
    <input runat="server" id="lblSep" type="hidden" value="<%$ Resources:MonthResource, September%>" />
    <input runat="server" id="lblOct" type="hidden" value="<%$ Resources:MonthResource, October%>" />
    <input runat="server" id="lblNov" type="hidden" value="<%$ Resources:MonthResource, November%>" />
    <input runat="server" id="lblDec" type="hidden" value="<%$ Resources:MonthResource, December%>" />
    <input runat="server" id="lblCultureInfo" type="hidden" /><input runat="server" id="hidCurInsuranceCompany" type="hidden" /><input runat="server" id="hidCurrentInsurer" type="hidden" />
</div>

<script type="text/javascript">
    function SetDisplay(val) {
        var select = document.getElementById('<%=ddlDeduct.ClientID%>');
        for (i = 0; i < select.options.length; i++) {
            if (select.options[i].value == '-1') {
                select.options[i] = null;
                break;
            }
        }
        if (val == "10") {
            var opt = document.createElement("option");
            opt.text = '<%= Resources.CarInsurance.Option_DeductAll%>';
            opt.value = "-1";
            select.options.add(opt);
            document.getElementById('<%=rdoNoCTPL.ClientID%>').checked = true;
            document.getElementById('<%=divGarageType.ClientID%>').style.display = '';
            document.getElementById('<%=divYesAccMod.ClientID%>').style.display = '';
            document.getElementById('<%=divProvinceofRegistration.ClientID%>').style.display = '';
            document.getElementById('<%=idAnyClaimLastYear.ClientID%>').style.display = '';
            document.getElementById('<%=idNCB.ClientID%>').style.display = '';
            document.getElementById('<%=divDriver.ClientID%>').style.display = '';
            document.getElementById('<%=divDeduct.ClientID%>').style.display = '';
            document.getElementById('<%=divCTPL.ClientID%>').style.display = 'none';
            document.getElementById('<%=ddlNCB.ClientID%>').value = "50";
        }
        else if (val == "21" || val == "31") {
            document.getElementById('<%=rdoNoCTPL.ClientID%>').checked = true;
            document.getElementById('<%=divGarageType.ClientID%>').style.display = '';
            document.getElementById('<%=divDeduct.ClientID%>').style.display = '';
            document.getElementById('<%=divProvinceofRegistration.ClientID%>').style.display = 'none';
            document.getElementById('<%=idAnyClaimLastYear.ClientID%>').style.display = 'none';
            document.getElementById('<%=idNCB.ClientID%>').style.display = 'none';
            document.getElementById('<%=divDriver.ClientID%>').style.display = 'none';
            document.getElementById('<%=divYesAccMod.ClientID%>').style.display = 'none';
            document.getElementById('<%=divCTPL.ClientID%>').style.display = 'none';
        }
        else {
            document.getElementById('<%=divCTPL.ClientID%>').style.display = '';
            document.getElementById('<%=divGarageType.ClientID%>').style.display = 'none';
            document.getElementById('<%=divProvinceofRegistration.ClientID%>').style.display = 'none';
            document.getElementById('<%=idAnyClaimLastYear.ClientID%>').style.display = 'none';
            document.getElementById('<%=idNCB.ClientID%>').style.display = 'none';
            document.getElementById('<%=divDriver.ClientID%>').style.display = 'none';
            document.getElementById('<%=divYesAccMod.ClientID%>').style.display = 'none';
            document.getElementById('<%=divDeduct.ClientID%>').style.display = 'none';
        }
    }

    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_initializeRequest(InitializeRequest);
    prm.add_endRequest(EndRequest);
    var postBackElement;
    function InitializeRequest(sender, args) {
        if (prm.get_isInAsyncPostBack())
            args.set_cancel(true);
        postBackElement = args.get_postBackElement();
        //|| postBackElement.id == '<%=rdoYesAddDriver.ClientID%>'
        //|| postBackElement.id == '<%=rdoNoAddDriver.ClientID%>'
        /*if (postBackElement.id == '<%=ddlInsuranceType.ClientID%>'
        || postBackElement.id == '<%=ddlManufactYear.ClientID%>'
        || postBackElement.id == '<%=ddlCarMake.ClientID%>'
        || postBackElement.id == '<%=ddlModelBodyCCDoor.ClientID%>'
        || postBackElement.id == '<%=rdoYesClaimLastYear.ClientID%>'
        || postBackElement.id == '<%=rdoNoClaimLastYear.ClientID%>'
        ) {
        OnOffUpdateProgress(true);
        }*/
        OnOffUpdateProgress(true);
    }

    function OnOffUpdateProgress(onOff) {
        $get('<%=ddlInsuranceType.ClientID%>').disabled = onOff;
        $get('<%=ddlManufactYear.ClientID%>').disabled = onOff;
        $get('<%=ddlCarMake.ClientID%>').disabled = onOff;
        $get('<%=ddlModelBodyCCDoor.ClientID%>').disabled = onOff;
        $get('<%=ddlVehicleType.ClientID%>').disabled = onOff;
        $get('<%=rdoYesAccMod.ClientID%>').disabled = onOff;
        $get('<%=rdoNoAccMod.ClientID%>').disabled = onOff;
        $get('<%=txtAccModAmount.ClientID%>').disabled = onOff;
        if ($get('<%=rdoYesAddDriver.ClientID%>') != null)
            $get('<%=rdoYesAddDriver.ClientID%>').disabled = onOff;
        if ($get('<%=rdoNoAddDriver.ClientID%>') != null)
            $get('<%=rdoNoAddDriver.ClientID%>').disabled = onOff;
        if ($get('<%=ddlDriverCount.ClientID%>') != null)
            $get('<%=ddlDriverCount.ClientID%>').disabled = onOff;
        //$get('<%=rdoYesClaimLastYear.ClientID%>').disabled = onOff;
        //$get('<%=rdoNoClaimLastYear.ClientID%>').disabled = onOff;
        //$get('<%=rdoYesAddDriver.ClientID%>').disabled = onOff;
        //$get('<%=rdoNoAddDriver.ClientID%>').disabled = onOff;
    }

    function EndRequest(sender, args) {
        if (postBackElement.id == '<%=ddlInsuranceType.ClientID%>'
                    || postBackElement.id == '<%=ddlManufactYear.ClientID%>'
                    || postBackElement.id == '<%=ddlCarMake.ClientID%>'
                    || postBackElement.id == '<%=ddlModelBodyCCDoor.ClientID%>'
                    || postBackElement.id == '<%=rdoYesClaimLastYear.ClientID%>'
                    || postBackElement.id == '<%=rdoNoClaimLastYear.ClientID%>'
                    || postBackElement.id == '<%=rdoYesAddDriver.ClientID%>'
                    || postBackElement.id == '<%=rdoNoAddDriver.ClientID%>'
                    || postBackElement.id == '<%=ddlVehicleType.ClientID%>'
                    || postBackElement.id == '<%=ddlDriverCount.ClientID%>') {
            CheckAccMod();
            OnOffUpdateProgress(false);
            //JT_init();
        }
    }

    function ShowHideDiv(divName, varOnOff) {
        if (varOnOff) {
            document.getElementById(divName).style.display = "";
        }
        else {
            document.getElementById(divName).style.display = "none";
        }
    }

    function showhide(el) {

        el = document.getElementById(el);
        el.style.display = (el.style.display == "none") ? "block" : "none";

    }

    window.onload = function() {
        //showhide('divCarMakeModel');
        //CheckedChanged();
        CheckAccMod();
    }

    var CarMakeModel;
    var ArrCarMakeModel;

    function CarMakeClientValidate(source, arguments) {
        if (arguments.Value == -1) {
            arguments.IsValid = false;
        } else {
            arguments.IsValid = true;
        }
    }

    function CarModelClientValidate(source, arguments) {
        if (arguments.Value == -1) {
            arguments.IsValid = false;
        } else {
            arguments.IsValid = true;
        }
    }

    function ShowHideAccMod(varOnOff) {
        document.getElementById('divAccModAmount').style.display = varOnOff == true ? '' : 'none';
        ValidatorEnable(document.getElementById('<%=rfvAccModAmount.ClientID%>'), varOnOff);
        ValidatorEnable(document.getElementById('<%=revAccModAmount.ClientID%>'), varOnOff);
        ValidatorEnable(document.getElementById('<%=csvAccModAmount.ClientID%>'), varOnOff);
    }

    function CheckOptionValidationCss() {
        //CheckRedPlateValidationCss();
        CheckClaimValidationCss();
        CheckCTPLValidationCss();
        CheckAccModValidationCss();
        //alert(document.getElementById('<%=divSpecifyDriver.ClientID%>'));
        if (document.getElementById('<%=divSpecifyDriver.ClientID%>') != null) {
            CheckAddDriverValidationCss();
        }
    }

    //CAR POLICY DETAILS HERE

    function CheckAccModAmount(source, arguments) {
        var _retValue = true;
        var _amount = parseInt(document.getElementById("<%=txtAccModAmount.ClientID%>").value);
        //alert(_amount);
        var txtSumInsured = document.getElementById("<%=txtSumInsured.ClientID%>");
        var lblSumInsured = document.getElementById("<%=lblSumInsured.ClientID%>");
        var txtNewSumInsured = document.getElementById("<%=txtNewSumInsured.ClientID%>");
        var _sumAmount = txtSumInsured.value;
        if (_sumAmount != null) {
            if (_sumAmount <= 0) {
                _sumAmount = 0;
            }
        }
        else {
            _sumAmount = 0;
        }

        //alert(_sumAmount);
        if (_sumAmount > 0 && _amount > 0) {
            if (_amount > 100000) {
                //alert("Accessary or Modifications Amount should NOT be greater than 100,000\nor 10% of Sum Insured Amount");
                //alert("Invalid amount!");
                _retValue = false;
            }
            else if (_amount > (_sumAmount * 0.1)) {
                //alert("Accessary or Modifications Amount should NOT be greater than 100,000or 10% of Sum Insured Amount");
                //alert("Invalid amount!");
                _retValue = false;
            }
            else if (_amount < 1000) {
                //alert("Accessories or Modifications amount should be greater than or equal 1000.");

                _retValue = false;
            }

            if (_retValue == true) {
                txtNewSumInsured.value = parseInt(txtSumInsured.value) + parseInt(_amount);
                if (lblSumInsured != null)
                    lblSumInsured.innerHTML = addCommas(txtNewSumInsured.value.toString());
            }
        }
        else {
            _retValue = false;
            //alert("Please select car model first.");
        }

        arguments.IsValid = _retValue;
    }

    function CheckCTPLValidationCss() {
        var ctrlDivYes = 'divYesCTPL';
        var ctrlDivNo = 'divNoCTPL';
        var txtText = '<%=txtCTPL.ClientID%>';
        var valCtrl = '<%=rfvCTPL.ClientID%>';
        ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
        return true;
    }

    function CheckAccModValidationCss() {
        var ctrlDivYes = 'divYesAccMod';
        var ctrlDivNo = 'divNoAccMod';
        var txtText = '<%=txtAccMod.ClientID%>';
        var valCtrl = '<%=rfvAccMod.ClientID%>';
        ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
        return true;
    }

    function CheckRedPlateValidationCss() {
        var ctrlDivYes = 'divYesRedPlate';
        var ctrlDivNo = 'divNoRedPlate';
        var txtText = '<=txtRedPlate.ClientID>';
        var valCtrl = '<=rfvRedPlate.ClientID>';
        ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
        return true;
    }

    function CheckClaimValidationCss() {
        var ctrlDivYes = 'divYesClaimLastYear';
        var ctrlDivNo = 'divNoClaimLastYear';
        var txtText = '<%=txtAnyClaim.ClientID%>';
        var valCtrl = '<%=rfvAnyClaim.ClientID%>';
        ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
        return true;
    }

    function CheckAddDriverValidationCss() {
        var ctrlDivYes = 'divYesAddDriver';
        var ctrlDivNo = 'divNoAddDriver';
        var txtText = '<%=txtAddDriver.ClientID%>';
        var valCtrl = '<%=rfvAddDriver.ClientID%>';
        ShowValidationEffectOption(ctrlDivYes, ctrlDivNo, txtText, valCtrl);
        return true;
    }

    function CheckRedPlate() {
        var ctrlTxt = document.getElementById('<=txtRedPlate.ClientID>');
        var ctrlY = document.getElementById('<=rdoYesRedPlate.ClientID>');
        var ctrlN = document.getElementById('<=rdoNoRedPlate.ClientID>');
        var valCtrl = document.getElementById('<=rfvRedPlate.ClientID>');

        if (ctrlY.checked == true || ctrlN.checked == true) {
            ctrlTxt.value = '1';
            valCtrl.style.visibility = 'hidden';
        }
        else {
            ctrlTxt.value = '';
        }
    }

    function CheckClaim() {
        var ctrlTxt = document.getElementById('<%=txtAnyClaim.ClientID%>');
        var ctrlY = document.getElementById('<%=rdoYesClaimLastYear.ClientID%>');
        var ctrlN = document.getElementById('<%=rdoNoClaimLastYear.ClientID%>');
        var valCtrl = document.getElementById('<%=rfvAnyClaim.ClientID%>');

        if (ctrlY.checked == true || ctrlN.checked == true) {
            ctrlTxt.value = '1';
            valCtrl.style.visibility = 'hidden';
        }
        else {
            ctrlTxt.value = '';
        }
    }

    function CheckCTPL() {
        var ctrlTxt = document.getElementById('<%=txtCTPL.ClientID%>');
        var ctrlY = document.getElementById('<%=rdoYesCTPL.ClientID%>');
        var ctrlN = document.getElementById('<%=rdoNoCTPL.ClientID%>');
        var valCtrl = document.getElementById('<%=rfvCTPL.ClientID%>');

        if (ctrlY.checked == true || ctrlN.checked == true) {
            ctrlTxt.value = '1';
            valCtrl.style.visibility = 'hidden';
        }
        else {
            ctrlTxt.value = '';
        }
    }

    function CheckAccMod() {

        var ctrlTxt = document.getElementById('<%=txtAccMod.ClientID%>');
        var ctrlY = document.getElementById('<%=rdoYesAccMod.ClientID%>');
        var ctrlN = document.getElementById('<%=rdoNoAccMod.ClientID%>');
        var valCtrl = document.getElementById('<%=rfvAccMod.ClientID%>');
        var txtNewSumInsured = document.getElementById('<%=txtNewSumInsured.ClientID%>');
        var txtSumInsured = document.getElementById('<%=txtSumInsured.ClientID%>');
        var lblSumInsured = document.getElementById('<%=lblSumInsured.ClientID%>');
        var txtAccModAmount = document.getElementById('<%=txtAccModAmount.ClientID%>');

        if (ctrlY.checked == true || ctrlN.checked == true) {
            ctrlTxt.value = '1';
            valCtrl.style.visibility = 'hidden';
            if (ctrlY.checked == true) {
                ShowHideAccMod(true);
                if (lblSumInsured != null)
                    lblSumInsured.innerHTML = addCommas(txtNewSumInsured.value.toString());
            }
            else {
                ShowHideAccMod(false);
                txtAccModAmount.value = "0";
                txtNewSumInsured.value = txtSumInsured.value;
                //alert(_SumInsured.toString());
                if (lblSumInsured != null)
                    lblSumInsured.innerHTML = addCommas(txtSumInsured.value.toString());
            }
        }
        else {
            ctrlTxt.value = '';
            ShowHideAccMod(false);
        }
    }

    function addCommas(nStr) {
        nStr += '';
        var x = nStr.split('.');
        var x1 = x[0];
        var x2 = x.length > 1 ? '.' + x[1] : '';
        var rgx = /(\d+)(\d{3})/;
        while (rgx.test(x1)) {
            x1 = x1.replace(rgx, '$1' + ',' + '$2');
        }
        return x1 + x2;
    }

    function CheckAddDriver() {
        //alert('CheckAddDriver');
        var ctrlTxt = document.getElementById('<%=txtAddDriver.ClientID%>');
        var ctrlY = document.getElementById('<%=rdoYesAddDriver.ClientID%>');
        var ctrlN = document.getElementById('<%=rdoNoAddDriver.ClientID%>');
        var valCtrl = document.getElementById('<%=rfvAddDriver.ClientID%>');
        var ddlDrvCount = document.getElementById('<%=ddlDriverCount.ClientID%>');
        var divAddDriver = document.getElementById('<%=divAddDriver.ClientID%>');

        if (ctrlY.checked == true || ctrlN.checked == true) {
            ctrlTxt.value = '1';
            valCtrl.style.visibility = 'hidden';
        }
        else {
            ctrlTxt.value = '';
        }

        if (ctrlY.checked == true) {
            if (ddlDrvCount != null) {
                ddlDrvCount.disabled = false;
                //showhideDriver();
            }
            if (divAddDriver != null) divAddDriver.style.display = '';
        }
        else {
            //ddlDrvCount.options(0).selected = true;
            if (ddlDrvCount != null) {
                ddlDrvCount.selectedIndex = 0;
                ddlDrvCount.disabled = true;
                //showhideDriver();
            }
            if (divAddDriver != null) divAddDriver.style.display = 'none';
        }
    }

    function CheckInsuranceType() {
        var ddlInsuranceType = document.getElementById("<%=ddlInsuranceType.ClientID%>");
        var divSumInsured = document.getElementById("divSumInsured");
        //var txtSumInsured = document.getElementById("<%=txtSumInsured.ClientID%>");
        //alert(ddlInsuranceType.value);
        //alert(divSumInsured.id);
        if (ddlInsuranceType.value >= 20) {
            divSumInsured.style.display = 'none';
            //txtSumInsured.value = '0';
        }
        else {
            divSumInsured.style.display = '';
        }
    }

    function ShowHideAll() {
        try {
            CheckInsuranceType();
            //IncreaseProgress(100);
            //HideLoading();
        }
        catch (ex) {
            alert(ex.name + ' ' + ex.message);
        }
    }

    OnOffUpdateProgress(false);
</script>

